home *** CD-ROM | disk | FTP | other *** search
/ IRIX 6.3 Development Libraries / SGI IRIX 6.3 Development Libraries.iso / dist / dist6.3 / ViewKit_dev.idb / usr / include / Vk / VkPie.h.z / VkPie.h
C/C++ Source or Header  |  1996-09-20  |  3KB  |  77 lines

  1. ////////////////////////////////////////////////////////////////////////////////
  2. ///////   Copyright 1992, Silicon Graphics, Inc.  All Rights Reserved.   ///////
  3. //                                                                            //
  4. // This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;     //
  5. // the contents of this file may not be disclosed to third parties, copied    //
  6. // or duplicated in any form, in whole or in part, without the prior written  //
  7. // permission of Silicon Graphics, Inc.                                       //
  8. //                                                                            //
  9. // RESTRICTED RIGHTS LEGEND:                                                  //
  10. // Use,duplication or disclosure by the Government is subject to restrictions //
  11. // as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data     //
  12. // and Computer Software clause at DFARS 252.227-7013, and/or in similar or   //
  13. // successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -    //
  14. // rights reserved under the Copyright Laws of the United States.             //
  15. //                                                                            //
  16. ////////////////////////////////////////////////////////////////////////////////
  17.  
  18. #ifndef VKPIE_H
  19. #define VKPIE_H
  20.  
  21. #include <Vk/VkMeter.h>
  22.  
  23. class VkPie : public VkMeter {
  24.  
  25.   public:
  26.     
  27.     VkPie(const char * name, Widget);
  28.     virtual ~VkPie();
  29.     void setRadius(int radius);
  30.     void setLeftTextPosition(int percent) { _leftTextPosition = percent; }
  31.  
  32.     Dimension neededWidth() { computeBounds(); return _desiredWidth; }
  33.     Dimension neededHeight(){ computeBounds(); return _desiredHeight; }
  34.     
  35.     virtual const char* className();
  36.  
  37.     static VkComponent *CreateVkPie(const char *name, Widget parent);
  38.     
  39.   protected:
  40.  
  41.     double degreesToRadians(int angle);
  42.  
  43.     void computePixelPosition(int x, int y, int width, int height, int angle,
  44.                 int *x_return, int *y_return);
  45.  
  46.     void drawPieEdges(XPoint *points, GC gc, int flags);
  47.  
  48.     void drawPieCrust(int x, int y, int width, int height);
  49.  
  50.     void drawPieQuadrantSlice(int x, int y, int width, int height,
  51.                   Pixel bg, int start, int end,
  52.                   int bottom, int top, int flags);
  53.  
  54.     void drawPieSlices ( int x, int y, int width, int height,
  55.              MeterInfo *info, int num );
  56.        
  57.     void draw();
  58.   
  59.     int _radius;
  60.  
  61.     int _leftTextPosition;
  62.  
  63.     virtual void computeBounds();
  64.  
  65.     Dimension _desiredWidth;
  66.     Dimension _desiredHeight;
  67.  
  68. private:
  69.  
  70.    static String _resources[];
  71.    static XtResource _resSpec [];
  72.  
  73.     
  74. }; 
  75.  
  76. #endif
  77.